<?php

namespace App\Controllers;

class Movie extends BaseController {

    public function getIndex() {
        // connect to the model 
        $actors = new \App\Models\Actors();
        // retrieve all the records 
        $records = $actors->findAll();

        // get a template parser 
        $parser = \Config\Services::parser();
        // tell it about the substitions 
        return $parser->setData(['records' => $records])
                        // and have it render the template with those 
                        ->render('actorslist');
    }

    public function getShowme($id) {
        // connect to the model 
        $actors = new \App\Models\Actors();
        // retrieve all the records 
        $record = $actors->find($id);
        // get a template parser 
        $parser = \Config\Services::parser();
        // tell it about the substitions 
        return $parser->setData($record)
        // and have it render the template with those 
                        ->render('oneactor');
    }

}
